<div id="content" class="inputForm">
	<?php
		include_once '../com/mss/action/UserAction.php';
		
		$first_name = "";
		$last_name = "";
		$login_id = "";
		$password = "";
		$mobile = "";
		$email = "";
		$errors = array();
		$errors['success'] = "START";
		
		if (isset($_POST['submit'])) {
			$first_name = $_POST['first_name'];
			$last_name = $_POST['last_name'];
			$login_id = $_POST['login_id'];
			$password = $_POST['password'];
			$type = $_POST['type'];
			$mobile = $_POST['mobile'];
			$email = $_POST['email'];

			$user = new User("", $first_name, $last_name, $login_id, $password, $type, $mobile, $email);
			$user_action = new UserAction();
			$errors = $user_action->addUser($user);
		}
	?>
	<h4>Add User</h4>
	<?php 
	if ($errors['success'] != "START") {
		include_once 'info.php';
	}
	?>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		<table class="inputFormTable">
			<tr>
				<td><label>First Name<span class="required">*</span></label></td>
				<td><input type="text" name="first_name" width="200px;" /></td>
			</tr>
			<tr>
				<td><label>Last Name</label></td>
				<td><input type="text" name="last_name" width="200px;" /></td>
			</tr>
			<tr>
				<td><label>Login ID<span class="required">*</span></label></td>
				<td><input type="text" name="login_id" width="200px;" /></td>
			</tr>
			<tr>
				<td><label>Password<span class="required">*</span></label></td>
				<td><input type="password" name="password" width="200px;" /></td>
			</tr>
			<tr>
				<td><label>Type</label><span class="required">*</span></td>
				<td>
					<select name="type">
						<option value="0">Admin</option>
						<option value="1" selected="selected">System</option>
					</select>
				</td>
			</tr>
			<tr>
				<td><label>Mobile</label></td>
				<td><input type="text" name="mobile" width="200px;" /></td>
			</tr>
			<tr>
				<td><label>E-Mail</label></td>
				<td><input type="text" name="email" width="200px;" /></td>
			</tr>
			<tr>
				<td></td>
				<td align="right"><input type="submit" name="submit" value="Submit" class="formbutton" align="right"/></td>
			</tr>
		</table>
	</form>
	<br><br>
</div>
